import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router";

// 2. 配置路由
const routes: Array<RouteRecordRaw> = [
    {
        path: "/",
        component: () => import("../pages/MainPage.vue"),
    },
    {
        name: "login",
        path: "/login",
        meta:{hide:true},
        component: () => import("../pages/Login.vue"),
    },
    {
        name: "My",
        path: "/My",
        component: () => import("../pages/My.vue"),
    },
    {
        name: "doctorPage",
        path: "/doctorPage",
        component: () => import("../pages/doctorPage.vue"),
    },
    {
        name: "MyReport",
        path: "/MyReport/:MyReport",
        meta:{hide:true},
        component: () => import("../pages/MyReport.vue"),
    },
    {
        name: "userInfo",
        path: "/userInfo",
        meta:{hide:true},
        component: () => import("../pages/UserInfo.vue"),
    },
    {
        name: "talkPage",
        path: "/talkPage/:doctorName",
        meta:{hide:true},
        component: () => import("../pages/talkPage.vue"),
    },
    {
        name: "fellback",
        path: "/fellback",
        meta:{hide:true},
        component: () => import("../pages/fellback.vue"),
    },
];
// 1.返回一个 router 实列，为函数，里面有配置项（对象） history
const router = createRouter({
    history: createWebHistory(),
    routes,
});

// 3导出路由   然后去 main.ts 注册 router.ts
export default router